package com.smart.tv.boundary;

import com.smart.tv.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class SmartTV extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.smart_hotel);
		LinearLayout llInformation 	= (LinearLayout) findViewById(R.id.smart_information);
		LinearLayout llRoom 		= (LinearLayout) findViewById(R.id.smart_room);
		LinearLayout llLoundry 		= (LinearLayout) findViewById(R.id.smart_loundry);
		LinearLayout llBilling 		= (LinearLayout) findViewById(R.id.smart_billing);
		
		llInformation.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,DuoMenu.class);
				intent.putExtra(DuoMenu.FIRST, R.drawable.info_information);
				intent.putExtra(DuoMenu.SECOND, R.drawable.info_map);
				intent.putExtra(DuoMenu.STATUS_MENU, DuoMenu.INFORMATION);
				startActivity(intent);
			}
		});
		llRoom.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "Room");
				startActivity(intent);
			}
		});
		llLoundry.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "Loundry");
				startActivity(intent);
			}
		});
		llBilling.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "Billing");
				startActivity(intent);
			}
		});
		
		setImageTable();
		setImageLink();
	}
	
	private void setImageTable(){
		ImageView ivMovie 	= (ImageView) findViewById(R.id.smart_movie);
		ImageView ivCafe 	= (ImageView) findViewById(R.id.smart_cafe);
		ImageView ivMusic 	= (ImageView) findViewById(R.id.smart_music);
		ImageView ivGames 	= (ImageView) findViewById(R.id.smart_games);
		ImageView ivNews 	= (ImageView) findViewById(R.id.smart_news);
		ImageView ivBooks 	= (ImageView) findViewById(R.id.smart_books);
		
		ivMovie.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, GalleryMenu.MOVIE);
				startActivity(intent);
			}
		});
		
		ivCafe.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "Cafe");
				startActivity(intent);
			}
		});
		
		ivMusic.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,ListMenu.class);
				intent.putExtra(ListMenu.STATUS_MENU, ListMenu.MUSIC);
				startActivity(intent);
			}
		});
		
		ivGames.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, GalleryMenu.GAME);
				startActivity(intent);
			}
		});

		ivNews.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "News");
				startActivity(intent);
			}
		});
		
		ivBooks.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(SmartTV.this,GalleryMenu.class);
				intent.putExtra(GalleryMenu.STATUS_MENU, "Books");
				startActivity(intent);
			}
		});
		
	}
	
	private void setImageLink(){
		ImageView ivKereta	= (ImageView) findViewById(R.id.smart_kereta);
		ImageView ivGaruda 	= (ImageView) findViewById(R.id.smart_garuda);
		ImageView ivBlue 	= (ImageView) findViewById(R.id.smart_blue_bird);
		ImageView ivEsl 	= (ImageView) findViewById(R.id.smart_esl);
		ImageView ivMcd 	= (ImageView) findViewById(R.id.smart_mcd);
		ImageView ivIndo 	= (ImageView) findViewById(R.id.smart_indomaret);
		

		ivKereta.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://www.kereta-api.co.id/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);			}
		});
		
		ivGaruda.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://www.garuda-indonesia.com/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);			}
		});
		
		ivBlue.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://www.bluebirdgroup.com/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);
			}
		});
		ivEsl.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://www.esl-express.com/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);			}
		});
		ivMcd.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://www.mcdonalds.co.id/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);			}
		});
		ivIndo.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String url = "http://indomaret.co.id/";
				Intent intent = new Intent(SmartTV.this, SmartWebView.class);
				intent.putExtra("url", url);
				startActivity(intent);			}
		});
		
		
	}
	
}
